package com.eng.carro.entities;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author RAFAEL
 */
@Entity
@Table(name = "core_users" )
public class User implements Serializable {

  private static final long serialVersionUID = -526276362800123146L;
  
  private DeliveryPlace defaultPlace;
  private Integer       id;
  private String        name;
  private Integer       role;
  private String        email;
  private String        password;
  private Integer       status;
  
  public User() {
  }

  public User( Integer id ) {
	setId(id);
  }

  
  @GeneratedValue( strategy = GenerationType.SEQUENCE )
  @Id
  @Column( name = "id" )
  public Integer getId() { return id; }
  public void setId(Integer id) { this.id = id; }

  @ManyToOne
  @JoinColumn( name = "ref_default_place" )
  public DeliveryPlace getDefaultPlace() { return defaultPlace; }
  public void setDefaultPlace(DeliveryPlace defaultPlace) { this.defaultPlace = defaultPlace; }

  @Column( name = "name" )
  public String getName() { return name; }
  public void setName(String name) { this.name = name; }

  @Column( name = "role" )
  public Integer getRole() { return role; }
  public void setRole(Integer role) { this.role = role; }

  @Column( name = "email" )
  public String getEmail() { return email; }
  public void setEmail(String email) { this.email = email; }

  @Column( name = "password" )
  public String getPassword() { return password; }
  public void setPassword(String password) { this.password = password; }
  
  @Column( name = "status" )
  public Integer getStatus() { return status; }
  public void setStatus(Integer status) { this.status = status; }
}
